﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SZSLSystem.Model;
using SZSLSystem.DAL;

namespace SZSLSystem.BLL
{
    /// <summary>
    /// 业务逻辑层：组织机构类型
    /// </summary>
    public partial class DataDictionary
    {
        private SZSLSystem.DAL.DataDictionary dal = new DAL.DataDictionary();

        public DataDictionary()
        {

        }

        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(Guid Id)
        {
            return dal.Exists(Id);
        }

        /// <summary>
        /// 检查用户名是否重复
        /// </summary>
        public bool Exists(string UserName)
        {
            return dal.Exists(UserName);
        }

        /// <summary>
        /// 返回数据总数(分页用到)
        /// </summary>
        public int GetCount(string strWhere)
        {
            return dal.GetCount(strWhere);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(SZSLSystem.Model.DataDictionary model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(SZSLSystem.Model.DataDictionary model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(Guid Id)
        {
            return dal.Delete(Id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SZSLSystem.Model.DataDictionary GetModel(Guid Id)
        {
            return dal.GetModel(Id);
        }

        /// <summary>
        /// 根据用户名取得一行数据给MODEL
        /// </summary>
        public SZSLSystem.Model.DataDictionary GetModel(string UserName)
        {
            return dal.GetModel(UserName);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }

        /// <summary>
        /// 获得查询分页数据
        /// </summary>
        public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
        {
            return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
        }

         /// <summary>
        /// 得到所有商品类别
        /// </summary>
        /// <returns></returns>
        public DataTable GetList(Guid ParID, bool flag)
        {
            return dal.GetList(ParID, flag);
        }

        #endregion  Method
    }
}
